<?php

namespace addons\service;

use app\common\library\Menu;
use think\Addons;

/**
 * 插件
 */
class Service extends Addons
{
    protected $menu = [
        [
            'name'    => 'service',
            'title'   => 'AJAX家政',
            'icon'    => 'fa fa-home',
            'ismenu'  => 1,
            'weigh'   => 1,
            'remark'  => '',
            'sublist' => [
            [
                'name'    => 'service/category',
                'title'   => '分类管理',
                'icon'    => 'fa fa-sliders',
                'ismenu'  => 1,
                'weigh'   => 80,
                'sublist' => [
                    ['name' => 'service/category/index', 'title' => '查看'],
                    ['name' => 'service/category/add', 'title' => '添加'],
                    ['name' => 'service/category/edit', 'title' => '编辑'],
                    ['name' => 'service/category/del', 'title' => '删除'],
                ]
            ],
            [
                'name'    => 'service/goods',
                'title'   => '平台项目',
                'icon'    => 'fa fa-shopping-bag',
                'ismenu'  => 1,
                'weigh'   => 78,
                'sublist' => [
                    ['name' => 'service/goods/index', 'title' => '查看'],
                    ['name' => 'service/goods/add', 'title' => '添加'],
                    ['name' => 'service/goods/edit', 'title' => '编辑'],
                    ['name' => 'service/goods/updategoodsstatus', 'title' => '更改项目状态'],
                ]
            ],
            [
                'name'    => 'service/skill',
                'title'   => '服务人员管理',
                'icon'    => 'fa fa-users',
                'ismenu'  => 1,
                'weigh'   => 70,
                'sublist' => [
                    ['name' => 'service/skill/skillcate', 'title' => '技能分类','icon' => 'fa fa-reorder','ismenu' => 1,'sublist'=>[
                        ['name' => 'service/skill/skillcate/index', 'title' => '查看'],
                        ['name' => 'service/skill/skillcate/add', 'title' => '添加'],
                        ['name' => 'service/skill/skillcate/edit', 'title' => '编辑'],
                    ]],
                    ['name' => 'service/skill/skillensure', 'title' => '保证金管理','icon' => 'fa fa-y-combinator-square','ismenu' => 1 ,'sublist'=>[
                        ['name' => 'service/skill/skillensure/index', 'title' => '查看'],
                        ['name' => 'service/skill/skillensure/add', 'title' => '添加'],
                        ['name' => 'service/skill/skillensure/edit', 'title' => '编辑'],
                        ['name' => 'service/skill/skillensure/del', 'title' => '删除'],
                    ]],
                    ['name' => 'service/skill/applyskill', 'title' => '申请列表','icon' => 'fa fa-id-card','ismenu' => 1,'sublist'=>[
                        ['name' => 'service/skill/applyskill/index', 'title' => '查看'],
                        ['name' => 'service/skill/applyskill/agree', 'title' => '同意'],
                        ['name' => 'service/skill/applyskill/refuse', 'title' => '拒绝'],
                    ]
                    ],
                    ['name' => 'service/skill/skill', 'title' => '服务人员','icon' => 'fa fa-user','ismenu' => 1,'sublist'=>[
                        ['name' => 'service/skill/skill/index', 'title' => '查看'],
                        ['name' => 'service/skill/skill/add', 'title' => '添加'],
                        ['name' => 'service/skill/skill/edit', 'title' => '编辑'],
                        ['name' => 'service/skill/skill/deduct', 'title' => '扣除保证金'],
                    ]

                    ],
                    ['name' => 'service/skill/perfect', 'title' => '完善资料','icon' => 'fa fa-image','ismenu' => 1,'sublist'=>[
                        ['name' => 'service/skill/perfect/index', 'title' => '查看'],
                        ['name' => 'service/skill/perfect/agree', 'title' => '同意'],
                        ['name' => 'service/skill/perfect/refuse', 'title' => '拒绝'],
                    ]
                    ],
                ]
            ],
            [
                'name'    => 'service/info',
                'title'   => '资料管理',
                'icon'    => 'fa fa-folder-open-o',
                'ismenu'  => 1,
                'weigh'   => 0,
                'sublist' => [
                    ['name' => 'service/info/commonquestions', 'title' => '帮助中心','icon' => 'fa fa-question-circle','ismenu' => 1,'sublist'=>[
                        ['name' => 'service/info/commonquestions/index', 'title' => '查看'],
                        ['name' => 'service/info/commonquestions/add', 'title' => '添加'],
                        ['name' => 'service/info/commonquestions/edit', 'title' => '编辑'],
                        ['name' => 'service/info/commonquestions/del', 'title' => '删除'],
                    ]],
                    ['name' => 'service/info/notice', 'title' => '平台公告','icon' => 'fa fa-volume-up','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/info/notice/index', 'title' => '查看'],
                        ['name' => 'service/info/notice/add', 'title' => '添加'],
                        ['name' => 'service/info/notice/edit', 'title' => '编辑'],
                        ['name' => 'service/info/notice/del', 'title' => '删除'],
                    ]
                    ],
                    ['name' => 'service/info/configtext', 'title' => '文本列表','icon' => 'fa fa-file-text','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/info/configtext/index', 'title' => '查看'],
                        ['name' => 'service/info/configtext/add', 'title' => '添加'],
                        ['name' => 'service/info/configtext/edit', 'title' => '编辑'],
                        ['name' => 'service/info/configtext/del', 'title' => '删除'],
                    ]
                    ],
                    ['name' => 'service/info/projectconfig/edit', 'title' => '文本配置','icon' => 'fa fa-cog','ismenu' => 1
                    ],
                ]
            ],
            [
                'name'    => 'service/config',
                'title'   => '平台管理',
                'icon'    => 'fa fa-th',
                'ismenu'  => 1,
                'weigh'   => 0,
                'sublist' => [
                    ['name' => 'service/config/thumb', 'title' => '轮播图','icon' => 'fa fa-image','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/config/thumb/index', 'title' => '查看'],
                        ['name' => 'service/config/thumb/add', 'title' => '添加'],
                        ['name' => 'service/config/thumb/edit', 'title' => '编辑'],
                        ['name' => 'service/config/thumb/del', 'title' => '删除'],
                    ]
                    ],
                    ['name' => 'service/config/jump', 'title' => '页面链接','icon' => 'fa fa-link','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/config/jump/index', 'title' => '查看'],
                        ['name' => 'service/config/jump/add', 'title' => '添加'],
                        ['name' => 'service/config/jump/edit', 'title' => '编辑'],
                        ['name' => 'service/config/jump/del', 'title' => '删除'],
                    ]
                    ],
                    ['name' => 'service/config/feedback', 'title' => '意见反馈','icon' => 'fa fa-pencil-square','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/config/feedback/index', 'title' => '查看'],
                        ['name' => 'service/config/feedback/add', 'title' => '添加'],
                        ['name' => 'service/config/feedback/edit', 'title' => '编辑'],
                        ['name' => 'service/config/feedback/del', 'title' => '删除'],
                    ]
                    ],
                    ['name' => 'service/config/train', 'title' => '培训内容','icon' => 'fa fa-book','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/config/train/index', 'title' => '查看'],
                        ['name' => 'service/config/train/add', 'title' => '添加'],
                        ['name' => 'service/config/train/edit', 'title' => '编辑'],
                        ['name' => 'service/config/train/del', 'title' => '删除'],
                    ]
                    ],
                    ['name' => 'service/config/refundreason', 'title' => '退款原因','icon' => 'fa fa-times-circle','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/config/refundreason/index', 'title' => '查看'],
                        ['name' => 'service/config/refundreason/add', 'title' => '添加'],
                        ['name' => 'service/config/refundreason/edit', 'title' => '编辑'],
                        ['name' => 'service/config/refundreason/del', 'title' => '删除'],
                    ]
                    ],
                    ['name' => 'service/config/complaintreason', 'title' => '投诉原因','icon' => 'fa fa-envelope','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/config/complaintreason/index', 'title' => '查看'],
                        ['name' => 'service/config/complaintreason/add', 'title' => '添加'],
                        ['name' => 'service/config/complaintreason/edit', 'title' => '编辑'],
                        ['name' => 'service/config/complaintreason/del', 'title' => '删除'],
                    ]
                    ],
                    ['name' => 'service/config/template/info', 'title' => '推送配置','icon' => 'fa fa-gg','ismenu' => 1],
                    ['name' => 'service/info/projectconfig/new', 'title' => '基础配置','icon' => 'fa fa-cog','ismenu' => 1],
                ]
            ],
            [
                'name'    => 'service/shop',
                'title'   => '商家管理',
                'icon'    => 'fa fa-bank',
                'ismenu'  => 1,
                'weigh'   => 68,
                'sublist' => [
                    ['name' => 'service/shop/shopensure', 'title' => '保证金管理','icon' => 'fa fa-y-combinator-square','ismenu' => 1,'weigh'=> 5
                        ,'sublist'=>[
                        ['name' => 'service/shop/shopensure/index', 'title' => '查看'],
                        ['name' => 'service/shop/shopensure/add', 'title' => '添加'],
                        ['name' => 'service/shop/shopensure/edit', 'title' => '编辑'],
                        ['name' => 'service/shop/shopensure/del', 'title' => '删除'],
                    ]
                    ],
                    ['name' => 'service/shop/applyshop', 'title' => '申请列表','icon' => 'fa fa-id-card','ismenu' => 1 ,'weigh' => 4
                        ,'sublist'=>[
                        ['name' => 'service/shop/applyshop/index', 'title' => '查看'],
                        ['name' => 'service/shop/applyshop/agree', 'title' => '同意'],
                        ['name' => 'service/shop/applyshop/refuse', 'title' => '拒绝'],
                    ]
                    ],
                    ['name' => 'service/shop/shop', 'title' => '商家管理','icon' => 'fa fa-cubes','ismenu' => 1,'weigh' => 3
                        ,'sublist'=>[
                        ['name' => 'service/shop/shop/index', 'title' => '查看'],
                        ['name' => 'service/shop/shop/edit', 'title' => '编辑'],
                    ]
                    ],
                    ['name' => 'service/shop/perfect', 'title' => '完善资料','icon' => 'fa fa-image','ismenu' => 1,'weigh' => 2
                        ,'sublist'=>[
                        ['name' => 'service/shop/perfect/index', 'title' => '查看'],
                        ['name' => 'service/shop/perfect/agree', 'title' => '同意'],
                        ['name' => 'service/shop/perfect/refuse', 'title' => '拒绝'],
                    ]
                    ],
                    ['name' => 'service/shop/goods', 'title' => '商家项目','icon' => 'fa fa-shopping-bag','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/shop/goods/index', 'title' => '查看'],
                        ['name' => 'service/shop/goods/edit', 'title' => '编辑'],
                        ['name' => 'service/shop/goods/del', 'title' => '删除'],
                        ['name' => 'service/shop/goods/agree', 'title' => '同意'],
                        ['name' => 'service/shop/goods/refuse', 'title' => '拒绝'],
                    ]
                    ],
                    ['name' => 'service/shop/coupon', 'title' => '商家优惠券','icon' => 'fa fa-cc-discover','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/shop/coupon/index', 'title' => '查看'],
                        ['name' => 'service/shop/coupon/edit', 'title' => '编辑'],
                        ['name' => 'service/shop/coupon/del', 'title' => '删除'],
                    ]
                    ],
                ]
            ],
            [
                'name'    => 'service/coupon',
                'title'   => '平台优惠券',
                'icon'    => 'fa fa-cc-discover',
                'ismenu'  => 1,
                'weigh'   => 76,
                'sublist' => [
                    ['name' => 'service/coupon/index', 'title' => '查看'],
                    ['name' => 'service/coupon/add', 'title' => '添加'],
                    ['name' => 'service/coupon/edit', 'title' => '编辑'],
                    ['name' => 'service/coupon/del', 'title' => '删除'],
                ]
            ],
            [
                'name'    => 'service/cityconfig',
                'title'   => '城市出行',
                'icon'    => 'fa fa-car',
                'ismenu'  => 1,
                'weigh'   => 76,
                'sublist' => [
                    ['name' => 'service/cityconfig/index', 'title' => '查看'],
                    ['name' => 'service/cityconfig/add', 'title' => '添加'],
                    ['name' => 'service/cityconfig/edit', 'title' => '编辑'],
                ]
            ],
            [
                'name'    => 'service/data',
                'title'   => '平台数据',
                'icon'    => 'fa fa-bar-chart-o',
                'ismenu'  => 1,
                'weigh'   => 100,
                'sublist' => []
            ],
            [
                'name'    => 'service/order',
                'title'   => '订单管理',
                'icon'    => 'fa fa-tasks',
                'ismenu'  => 1,
                'weigh'   => 90,
                'sublist' => [
                    ['name' => 'service/order/order', 'title' => '订单列表','icon' => 'fa fa-align-justify','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/order/order/index', 'title' => '查看'],
                        ['name' => 'service/order/order/info', 'title' => '订单详情'],
                        ['name' => 'service/order/order/updateshop', 'title' => '分配商家'],
                        ['name' => 'service/shop/order/updateskill', 'title' => '分配服务者'],
                        ['name' => 'service/shop/order/handleorder', 'title' => '操作订单'],
                    ]
                    ],
                    ['name' => 'service/order/refundorder', 'title' => '售后订单','icon' => 'fa fa-pause','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/order/refundorder/index', 'title' => '查看'],
                        ['name' => 'service/order/refundorder/refund', 'title' => '拒绝退款'],
                    ]
                    ],
                    ['name' => 'service/order/complaint', 'title' => '订单投诉','icon' => 'fa fa-legal','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/order/complaint/index', 'title' => '查看'],
                        ['name' => 'service/order/complaint/deduct', 'title' => '扣除保证金'],
                        ['name' => 'service/order/complaint/handle', 'title' => '已处理'],
                    ]
                    ],
                ]
            ],
            [
                'name'    => 'service/money',
                'title'   => '财务管理',
                'icon'    => 'fa fa-archive',
                'ismenu'  => 1,
                'weigh'   => 0,
                'sublist' => [
                    ['name' => 'service/money/recharge', 'title' => '余额充值','icon' => 'fa fa-money','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/money/recharge/index', 'title' => '查看'],
                    ]
                    ],
                    ['name' => 'service/money/shopensurepay', 'title' => '商户保证金','icon' => 'fa fa-align-center','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/money/shopensurepay/index', 'title' => '查看'],
                    ]
                    ],
                    ['name' => 'service/money/skillensurepay', 'title' => '服务者保证金','icon' => 'fa fa-align-center','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/money/skillensurepay/index', 'title' => '查看'],
                    ]
                    ],
                    ['name' => 'service/money/withdraw', 'title' => '提现管理','icon' => 'fa fa-database','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/money/withdraw/index', 'title' => '查看'],
                        ['name' => 'service/money/withdraw/agree', 'title' => '同意'],
                        ['name' => 'service/money/withdraw/refuse', 'title' => '拒绝'],
                        ['name' => 'service/money/withdraw/payment', 'title' => '已转账'],
                    ]
                    ],

                    ['name' => 'service/money/pluspay', 'title' => '会员充值','icon' => 'fa fa-ge','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/money/pluspay/index', 'title' => '查看'],
                    ]
                    ],

                    ['name' => 'service/money/usermoneylog', 'title' => '余额明细','icon' => 'fa fa-align-center','ismenu' => 0
                        ,'sublist'=>[
                        ['name' => 'service/money/usermoneylog/index', 'title' => '查看'],
                        ['name' => 'service/money/usermoneylog/deduct', 'title' => '余额充值'],
                    ]
                    ],
                    ['name' => 'service/money/serviceusermoneylog', 'title' => '平台余额明细','icon' => 'fa fa-align-center','ismenu' => 0
                        ,'sublist'=>[
                        ['name' => 'service/money/serviceusermoneylog/index', 'title' => '查看'],
                    ]
                    ],
                    ['name' => 'service/money/shopmoneylog', 'title' => '商户余额明细','icon' => 'fa fa-align-center','ismenu' => 0
                        ,'sublist'=>[
                        ['name' => 'service/money/shopmoneylog/index', 'title' => '查看'],
                    ]
                    ],
                    ['name' => 'service/money/shopusermoneylog', 'title' => '商户平台余额明细','icon' => 'fa fa-align-center','ismenu' => 0
                        ,'sublist'=>[
                        ['name' => 'service/money/shopusermoneylog/index', 'title' => '查看'],
                    ]
                    ],
                    ['name' => 'service/money/ensurelog', 'title' => '保证金明细','icon' => 'fa fa-align-center','ismenu' => 0
                        ,'sublist'=>[
                        ['name' => 'service/money/ensurelog/index', 'title' => '查看'],
                    ]
                    ],

                ]
            ],
            [
                'name'    => 'service/userlist',
                'title'   => '用户管理',
                'icon'    => 'fa fa-user-circle',
                'ismenu'  => 1,
                'weigh'   => 0,
                'sublist' => [
                    ['name' => 'service/config/plusconfig', 'title' => '会员设置','icon' => 'fa fa-cog','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/config/plusconfig/index', 'title' => '查看'],
                        ['name' => 'service/config/plusconfig/add', 'title' => '添加'],
                        ['name' => 'service/config/plusconfig/edit', 'title' => '编辑'],
                        ['name' => 'service/config/plusconfig/del', 'title' => '删除'],
                    ]
                    ],
                    ['name' => 'service/user', 'title' => '会员列表','icon' => 'fa fa-user','ismenu' => 1
                    ],
                ]
            ],
            [
                'name'    => 'service/configure/edit',
                'title'   => '平台配置',
                'icon'    => 'fa fa-cogs',
                'ismenu'  => 1,
                'weigh'   => 0,
                'sublist' => []
            ],
            [
                'name'    => 'service/goodsadd',
                'title'   => '附加项目管理',
                'icon'    => 'fa fa-cogs',
                'ismenu'  => 0,
                'weigh'   => 0,
                'sublist'=>[
                ['name' => 'service/goodsadd/index', 'title' => '查看'],
                ['name' => 'service/goodsadd/add', 'title' => '添加'],
                ['name' => 'service/goodsadd/edit', 'title' => '编辑'],
                ['name' => 'service/goodsadd/del', 'title' => '删除'],
            ]
            ],
            [
                'name'    => 'service/comment',
                'title'   => '评论管理',
                'icon'    => 'fa fa-comments',
                'ismenu'  => 1,
                'weigh'   => 0,
                'sublist' => [
                    ['name' => 'service/config/commentlabel', 'title' => '评论标签','icon' => 'fa fa-comments-o','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/config/commentlabel/index', 'title' => '查看'],
                        ['name' => 'service/config/commentlabel/add', 'title' => '添加'],
                        ['name' => 'service/config/commentlabel/edit', 'title' => '编辑'],
                        ['name' => 'service/config/commentlabel/del', 'title' => '删除'],
                    ]
                    ],
                    ['name' => 'service/order/comment', 'title' => '订单评价','icon' => 'fa fa-comment','ismenu' => 1
                        ,'sublist'=>[
                        ['name' => 'service/order/comment/index', 'title' => '查看'],
                        ['name' => 'service/order/comment/del', 'title' => '删除'],
                    ]
                    ],
                ]
            ],
        ]
    ]
];

    /**
     * 插件安装方法
     * @return bool
     */
    public function install()
    {
        Menu::create($this->menu);
        return true;
    }

    /**
     * 插件卸载方法
     * @return bool
     */
    public function uninstall()
    {
        Menu::delete("service");
        return true;
    }

    /**
     * 插件启用方法
     * @return bool
     */
    public function enable()
    {
        Menu::enable("service");
        return true;
    }

    /**
     * 插件禁用方法
     * @return bool
     */
    public function disable()
    {
        Menu::disable("service");
        return true;
    }

}
